package edu.pku.sei.gefcommon.descriptor.descriptors;


import org.eclipse.jface.viewers.CellEditor;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.ui.views.properties.PropertyDescriptor;

import edu.pku.sei.gefcommon.descriptor.views.PopupPropertySheetDialog;


public class ObjectPropertyDescriptor extends PropertyDescriptor {

	public ObjectPropertyDescriptor(Object id, String name,String catalog) {
		super(id,name);
		this.setCategory(catalog);
	}

	@Override
	public CellEditor createPropertyEditor(Composite parent) {
		if(value!=null){
			PopupPropertySheetDialog dialog = new PopupPropertySheetDialog(parent.getShell());
			dialog.setInput(value);
			dialog.open();
		}
		return null;
	}
	
	public void setValue(Object v) {
		value = v;
	}
//	public Object getValue() {
//		return value;
//	}

	private Object value;
}